Computing devices such as laptops, tablets and/or smart phones generally include a processor, memory and one or more peripheral devices. The processor may include one or more processing units, e.g., core(s), configured to execute one or more application(s). A process, i.e., an executing application, may include one or more thread(s). The processor may be configured to execute one or more process(es) and/or thread(s) generally in parallel. The process(es) and/or thread(s) may share the processing unit(s) in a time slice fashion, managed by, for example, a scheduler included in an operating system (OS).
The OS (and/or kernel associated with the OS) may be configured to synchronize memory accesses by a plurality of threads to prevent a second thread from accessing a memory location that a first thread has initiated an operation on that has not yet completed. Synchronization is configured to prevent race conditions where results of a read of a memory location depend on execution of order of the plurality of threads. Synchronization is generally implemented by a lock function (e.g., spin lock) configured to ensure that an associated operation is atomic, i.e., the associated operation, once started, completes and commits without another thread accessing the target memory location.
Although the following Detailed Description will proceed with reference being made to illustrative embodiments, many alternatives, modifications, and variations thereof will be apparent to those skilled in the art.